package cn.wp.ewallet.wallet.model.entity;

import cn.wp.common.core.dao.annotation.Column;
import cn.wp.common.core.dao.annotation.Table;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.nio.channels.FileLock;
import java.util.Date;

/**
 * @ClassName TransAccountLogDo
 * @Author ruixule
 * @Description TODO
 * @Date 2020/1/7 10:15
 */
@Data
@Table(value = "trans_account_log", keys = {"LOG_ID"})
public class TransAccountLogDo implements Serializable {


    //     转账记录唯一标识
    @Column("LOG_ID")
    private String logId;
    //     转出地址
    @Column("ADDRESS_FROM")
    private String addressFrom;
    @Column("ADDRESS_TO")
    private String addressTo;
    @Column("TRANS_TIME")
    private Date transTime;
    @Column("TRANS_AMOUNT")  //转账数量
    private BigDecimal transAmount;
    @Column("SERVICE_CHARGE")
    private BigDecimal serviceCharge;
    //    手续费之和 ,转出人账户 = 原账户 -（转出数量+手续费）,转入人账户=原账户+转出数量
    @Column("TOTAL_AMOUNT")
    private BigDecimal totalAmount;
    //    1000-转账成功  2000-转账失败
    @Column("OPER_RESULT")
    private String operResult;
    @Column("OPER_USER")
    private String operUser;
    @Column("REMARK")
    private String remark;

    @Column("MONEY_TYPE_ID")
    private String moneyTypeId;

    @Column("TH_ID")
    private String thId;


    /**
     * 操作类型
     * 1000-归集转账（归集时用户地址向中央账户转账）
     * 2000-归集矿工费（归集时中央账户转账给用户地址矿工费ETH）
     * 3000-提币转账（提币时中央账户给用户提供地址转账）
     * 4000-系统内部转账（系统内部SHQC之间转账）
     */
    @Column("OPER_TYPE")
    private String operType;

    /**
     * 提币申请单ID
     */
    @Column("REQ_ORDER_ID")
    private String reqOrderId;



    /**
     * 构造方法
     * @param logId
     * @param addressFrom
     * @param addressTo
     * @param transTime
     * @param transAmount
     * @param serviceCharge
     * @param totalAmount
     * @param operResult
     * @param operUser
     * @param remark
     */
    public TransAccountLogDo(String logId, String addressFrom, String addressTo, Date transTime,
                             BigDecimal transAmount, BigDecimal serviceCharge, BigDecimal totalAmount,
                             String operResult, String operUser, String remark,String moneyTypeId) {
        this.logId = logId;
        this.addressFrom = addressFrom;
        this.addressTo = addressTo;
        this.transTime = transTime;
        this.transAmount = transAmount;
        this.serviceCharge = serviceCharge;
        this.totalAmount = totalAmount;
        this.operResult = operResult;
        this.operUser = operUser;
        this.remark = remark;
        this.moneyTypeId=moneyTypeId;
    }

    public TransAccountLogDo(){

    }
}
